<?php
namespace app\validate;
use share\validate\SceneValidate;

class DeviceBaseChildValidate extends SceneValidate{

    /**
     * 通用规则
     */
    protected $rule = [
        'id' => 'require|integer',
        'level' => 'require|integer',
        'name' => 'require|length:2,16',
    ];    

    /**
     * 自定义场景的规则
     */
    protected $sceneRules = [
        'set' =>[
            'id' => 'require|integer',
            'level' => 'integer',
            'account' => 'length:2,16',
            'password' => 'length:6,20',
            'vendor' => 'length:2,20',
        ],
    ];

    protected $scene = [
        'list' => ['level','account','password','vendor'],
        'set' => ['id','level','account','password','vendor'],
        'del'  => ['id'],
    ];
}
